# -*- coding: utf-8 -*-
"""
-------------------------------------------------
# @Project  :data_visualization
# @File     :die.py
# @Date     :2021/8/6 14:51
# @Author   :逆羽
# @Email    :xiehouxiayu@163.com
# @IDE      :PyCharm
-------------------------------------------------
"""
from random import randint


class Die:
    """表示一个骰子的类"""
    def __init__(self, num_sides=6):
        """骰子默认为6面"""
        self.num_sides = num_sides

    def roll(self):
        """返回一个位于1和骰子面数之间的随机值"""
        return randint(1, self.num_sides)